<?php
class tbl_block_log extends AppModel{

    public $useTable = 'tbl_block_log';
    public $useDbConfig = 'log_db';
    public $primaryKey = 'block_num';

    public function get_date()
    {
        $params = array(
            'conditions' => array(
                'enable' => 0
            ),
            'fields' => array(
                'block_num', 'a2x_id', 'start_date', 'end_date'
            ),
        );

        $data = $this->find('all', $params);

        return $data;
    }

    public function get_account($_id)
    {
        $params = array(
            'conditions' => array(
                'a2x_id' => $_id
            )
        );

        $data = $this->find('count', $params);

        return $data;
    }
}